package com.huawei.appgallery.forum.posts.view;

import android.app.ActionBar;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.MeasureSpec;
import android.view.View.OnClickListener;
import android.view.View.OnFocusChangeListener;
import android.view.View.OnLayoutChangeListener;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.ViewStub;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.TranslateAnimation;
import android.view.inputmethod.InputMethodManager;
import android.widget.AbsListView;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.PopupMenu;
import android.widget.PopupMenu.OnMenuItemClickListener;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.Nullable;
import com.huawei.appgallery.common.media.api.IMediaSelectProtocol;
import com.huawei.appgallery.common.media.api.IMediaSelectResult;
import com.huawei.appgallery.common.media.api.OriginalMediaBean;
import com.huawei.appgallery.forum.base.card.bean.Post;
import com.huawei.appgallery.forum.base.card.bean.Section;
import com.huawei.appgallery.forum.base.card.bean.User;
import com.huawei.appgallery.forum.base.card.bean.VideoInfo;
import com.huawei.appgallery.forum.base.https.jgw.JGWTabDetailResponse;
import com.huawei.appgallery.forum.base.ui.ForumActivity;
import com.huawei.appgallery.forum.posts.api.IPostDetailProtocol;
import com.huawei.appgallery.forum.posts.api.IPostDetailResult;
import com.huawei.appgallery.forum.posts.card.ForumPostDetailHeadCardBean;
import com.huawei.appgallery.forum.section.api.ISectionDetailActivityProtocol;
import com.huawei.appgallery.foundation.ui.framework.cardframe.bean.BaseDetailResponse.LayoutData;
import com.huawei.appgallery.foundation.ui.framework.cardframe.fragment.TaskFragment;
import com.huawei.appgallery.foundation.ui.framework.cardframe.fragment.TaskFragment.e;
import com.huawei.appmarket.support.video.VideoPlayer;
import com.huawei.hmf.annotation.ActivityDefine;
import huawei.widget.HwCounterTextLayout;
import java.math.BigDecimal;
import java.util.List;
import o.azb;
import o.bqx;
import o.bqy;
import o.brd;
import o.bsd;
import o.bse;
import o.bsn;
import o.bsv;
import o.btb;
import o.buk;
import o.bwx;
import o.bxc;
import o.bxz;
import o.bya;
import o.byd;
import o.bye;
import o.byg;
import o.byj;
import o.byl;
import o.bzd;
import o.bzd.a;
import o.bzd.f;
import o.bzd.g;
import o.bzd.h;
import o.bzd.j;
import o.bzr;
import o.bzu;
import o.cbh;
import o.cgv;
import o.cil;
import o.cim;
import o.cvt;
import o.dgh;
import o.doo;
import o.ContentManager;
import o.ean;
import o.epo;
import o.epr;
import o.CollectCheck;
import o.eqx;
import o.erq;
import o.ActivityUtil;
import o.evk;
import o.evr;
import o.fho;
import o.fhq;
import o.fiu;
import o.fjb;
import o.fjc;
import o.fjf;
import o.fjm;
import o.fjo;
import o.fjq;
import o.fke;
import o.fkg;
import o.FragmentTransaction;
import o.ll;

@ActivityDefine(alias = "post.detail.inner.activity", protocol = IPostDetailProtocol.class, result = IPostDetailResult.class)
public class PostDetailActivity extends ForumActivity implements e, bzu, OnLayoutChangeListener, OnClickListener, buk {
    private int ʹ = -1;
    private boolean ʻˊ = false;
    private int ʻˋ = -1;
    protected long ʻॱ;
    private boolean ʻᐝ = false;
    private boolean ʼˊ = false;
    private int ʼˋ = -1;
    private int ʼᐝ;
    private int ʽˊ;
    private byl ʽˋ;
    private boolean ʽॱ = false;
    private Handler ʽᐝ;
    private int ʾ;
    private int ʾॱ;
    private String ʿ;
    private TextView ˈ;
    private long ˈॱ;
    private View ˉ;
    private boolean ˉॱ;
    private int ˊʻ = -1;
    private int ˊʼ = 0;
    private View ˊˊ;
    private View ˊˋ;
    private ViewStub ˊᐝ;
    private VideoPlayer ˋˊ;
    private View ˋˋ;
    bwx ˋॱ;
    private View ˋᐝ;
    private View ˌ;
    private TextView ˍ;
    private ImageView ˎˎ;
    private View ˎˏ;
    private View ˏˎ;
    private ImageView ˏˏ;
    private ImageView ˑ;
    bxz ͺ;
    private EditText ͺॱ;
    private ImageView ـ;
    private View ॱʻ;
    private ImageView ॱʼ;
    private TextView ॱʽ;
    int ॱˊ;
    PostDetailFragment ॱˋ;
    bya ॱˎ;
    private View ॱͺ;
    private View ᐝˊ;
    private ProgressBar ᐝˋ;
    fjb ᐝॱ;
    private ImageView ᐝᐝ;
    private PopupMenu ᐧ;
    private int ᐨ;
    private Post ᶥ;
    private int ㆍ;
    private Section ꓸ;
    private int ꜞ;
    private int ꜟ;
    private String ꞌ;
    private User ﹳ;
    private int ﾞ = -1;
    private int ﾟ = -1;

    public interface c {
        void ˎ(boolean z);
    }

    static class b implements fjq<Boolean> {
        private final c ˊ;

        b(c cVar) {
            this.ˊ = cVar;
        }

        public void onComplete(fjo<Boolean> o_fjo_java_lang_Boolean) {
            boolean z;
            if (o_fjo_java_lang_Boolean.ˊ() && ((Boolean) o_fjo_java_lang_Boolean.ॱ()).booleanValue()) {
                z = true;
            } else {
                z = false;
            }
            bqx.ˏ("PostDetailActivity", "check user result:" + z);
            if (this.ˊ != null) {
                this.ˊ.ˎ(z);
            }
        }
    }

    class d extends Handler {
        final /* synthetic */ PostDetailActivity ॱ;

        private d(PostDetailActivity postDetailActivity) {
            this.ॱ = postDetailActivity;
        }

        public void handleMessage(Message message) {
            if (message.getData() != null) {
                switch (message.what) {
                    case 1001:
                        this.ॱ.ᶥ();
                        return;
                    case 1002:
                        this.ॱ.ꓸ();
                        return;
                    case 1003:
                        this.ॱ.ˈ.setAlpha(((Float) message.obj).floatValue());
                        return;
                    case 1004:
                        this.ॱ.ˑ();
                        return;
                    default:
                        return;
                }
            }
        }
    }

    public void onCreate(@Nullable Bundle bundle) {
        super.onCreate(bundle);
        bqx.ˏ("PostDetailActivity", "onCreate");
        cgv.ˋ(this, a.ʽ, a.ʽ);
        setContentView(h.ˎ);
        this.ʽᐝ = new d();
        ActionBar actionBar = getActionBar();
        if (actionBar != null) {
            actionBar.hide();
        }
        this.ˌ = findViewById(o.bzd.b.ᐝˋ);
        this.ˊˊ = findViewById(o.bzd.b.ॱᶥ);
        azb.ˏ(this.ˊˊ);
        ˊˊ();
        IPostDetailProtocol iPostDetailProtocol = (IPostDetailProtocol) this.ˏॱ.ॱ();
        this.ʾ = iPostDetailProtocol.getSourceType();
        this.ʿ = iPostDetailProtocol.getUri();
        this.ʽॱ = iPostDetailProtocol.getNeedComment();
        this.ॱˊ = iPostDetailProtocol.getErrorCode();
        this.ˉॱ = iPostDetailProtocol.getPositionToCommentCard();
        this.ˊᐝ = (ViewStub) findViewById(o.bzd.b.ᐝʻ);
        ͺ();
        ˉ();
        this.ʻᐝ = false;
        this.ʻˊ = false;
        if (bundle == null) {
            ʼॱ();
        } else {
            this.ॱˋ = (PostDetailFragment) ˏॱ().findFragmentByTag("PostDetailActivity");
            this.ᶥ = (Post) bundle.getSerializable("param_post");
            this.ꓸ = (Section) bundle.getSerializable("param_section");
            this.ﹳ = (User) bundle.getSerializable("param_user");
            this.ꜞ = bundle.getInt("param_favorite", 0);
            this.ㆍ = bundle.getInt("param_like", 0);
            this.ﾟ = bundle.getInt("param_input_maxheight", -1);
            this.ʼˋ = bundle.getInt("param_input_maxheight_image", -1);
            this.ʹ = bundle.getInt("param_input_maxheight_land", -1);
            this.ʽˋ = (byl) bundle.getSerializable("param_select_image");
            this.ʻˋ = bundle.getInt("param_select_image_height", -1);
            this.ʽॱ = false;
            this.ʾॱ = bundle.getInt("param_ismyselfmoderator");
            this.ʽˊ = bundle.getInt("param_ismyselfhost");
            ˏ(this.ᶥ, this.ꓸ, this.ﹳ, this.ꜞ, this.ㆍ);
            ॱˊ();
        }
        ˎ(false, false);
    }

    private void ͺ() {
        if (ᐝॱ()) {
            this.ˊˊ.measure(MeasureSpec.makeMeasureSpec(0, 0), MeasureSpec.makeMeasureSpec(0, 0));
            this.ᐨ = this.ˊˊ.getMeasuredHeight();
            this.ˎˎ = (ImageView) findViewById(o.bzd.b.ॱˌ);
            this.ˍ = (TextView) findViewById(o.bzd.b.ॱᐨ);
        }
    }

    private boolean ᐝॱ() {
        return this.ʾ != 1;
    }

    private void ʼॱ() {
        try {
            if (this.ॱˊ > 0) {
                this.ˈ.setAlpha(1.0f);
            }
            fjb ˎ = fho.ˏ().ˋ("Posts").ˎ("post.detail.fragment");
            IPostDetailFrgProtocol iPostDetailFrgProtocol = (IPostDetailFrgProtocol) ˎ.ˊ();
            iPostDetailFrgProtocol.setUri(this.ʿ);
            iPostDetailFrgProtocol.setErrorCode(this.ॱˊ);
            iPostDetailFrgProtocol.setPaddingTop(this.ᐨ);
            iPostDetailFrgProtocol.setDomainId(this.ˊॱ);
            iPostDetailFrgProtocol.setPositionToCommentCard(this.ˉॱ);
            this.ॱˋ = (PostDetailFragment) fjm.ˏ(fiu.ˊ().ˋ(this, ˎ)).ˏ();
            FragmentTransaction ˊ = ˏॱ().ˊ();
            ˊ.ˏ(o.bzd.b.ˊʻ, this.ॱˋ, "PostDetailActivity");
            ˊ.ˋ();
        } catch (Throwable e) {
            bqx.ˊ("PostDetailActivity", "showFragment exception:", e);
        }
    }

    private void ˊˊ() {
        azb.ˏ(findViewById(o.bzd.b.ॱꞌ));
        this.ˈ = (TextView) findViewById(o.bzd.b.ॱꓸ);
        findViewById(o.bzd.b.ʽ).setOnClickListener(this);
        this.ˊˋ = findViewById(o.bzd.b.ㆍ);
        this.ˊˋ.setVisibility(8);
        this.ˊˋ.setOnClickListener(this);
        this.ˈ.setAlpha(0.0f);
    }

    private void ˎ(int i, float f) {
        ImageView imageView = (ImageView) this.ˌ.findViewById(o.bzd.b.ᐝᐝ);
        Drawable drawable = getResources().getDrawable(bzd.e.ᐝॱ);
        ImageView imageView2 = (ImageView) this.ˌ.findViewById(o.bzd.b.ॱˍ);
        Drawable drawable2 = getResources().getDrawable(bzd.e.ॱˋ);
        try {
            int ˊ = erq.ˊ(i, f);
            imageView2.setBackground(epo.ॱ(drawable2, ˊ));
            imageView.setBackground(epo.ॱ(drawable, ˊ));
        } catch (Exception e) {
            bqx.ˋ("PostDetailActivity", "updateIconColor error");
        }
    }

    private void ˉ() {
        ˊˋ();
        HwCounterTextLayout hwCounterTextLayout = (HwCounterTextLayout) findViewById(o.bzd.b.ॱᐝ);
        View findViewById = findViewById(o.bzd.b.ﾟ);
        this.ͺॱ = (EditText) findViewById(o.bzd.b.ˉॱ);
        findViewById.setOnClickListener(this);
        this.ᐝˊ = findViewById(o.bzd.b.ʻˊ);
        this.ͺॱ.addTextChangedListener(new TextWatcher(this) {
            final /* synthetic */ PostDetailActivity ॱ;

            {
                this.ॱ = r1;
            }

            public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
            }

            public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
                this.ॱ.ॱ(charSequence);
            }

            public void afterTextChanged(Editable editable) {
            }
        });
        this.ͺॱ.setFocusable(false);
        this.ͺॱ.setOnClickListener(new OnClickListener(this) {
            final /* synthetic */ PostDetailActivity ॱ;

            {
                this.ॱ = r1;
            }

            public void onClick(View view) {
                this.ॱ.ˋˋ();
            }
        });
        this.ͺॱ.setOnFocusChangeListener(new OnFocusChangeListener(this) {
            final /* synthetic */ PostDetailActivity ˎ;

            {
                this.ˎ = r1;
            }

            public void onFocusChange(View view, boolean z) {
                bqx.ˏ("PostDetailActivity", "onFocusChange:" + z);
                this.ˎ.ʻˊ = z;
            }
        });
        this.ͺॱ.setOnLongClickListener(null);
        this.ͺॱ.setLongClickable(false);
        this.ͺॱ.setTextIsSelectable(false);
        this.ꜟ = getWindowManager().getDefaultDisplay().getHeight() / 4;
        ˊᐝ();
        hwCounterTextLayout.setPaddingRelative(0, 0, 0, 0);
    }

    private void ˊˋ() {
        this.ˋᐝ = findViewById(o.bzd.b.ʹ);
        azb.ˏ(this.ˋᐝ);
        this.ˋˋ = findViewById(o.bzd.b.ꞌ);
        this.ˋˋ.setOnClickListener(this);
        this.ˎˏ = findViewById(o.bzd.b.ʽᐝ);
        this.ˏˏ = (ImageView) findViewById(o.bzd.b.ﹳ);
        this.ˏˎ = findViewById(o.bzd.b.ʼˋ);
        this.ˑ = (ImageView) findViewById(o.bzd.b.ʻᐝ);
        this.ॱʽ = (TextView) findViewById(o.bzd.b.ˋʼ);
        this.ॱͺ = findViewById(o.bzd.b.ʻˋ);
        this.ـ = (ImageView) findViewById(o.bzd.b.ʼˊ);
        this.ॱʻ = findViewById(o.bzd.b.ʽˋ);
        this.ॱʼ = (ImageView) findViewById(o.bzd.b.ʼᐝ);
        this.ᐝˋ = (ProgressBar) findViewById(o.bzd.b.ʽˊ);
        this.ॱʻ.setOnClickListener(this);
        this.ॱʻ.setClickable(false);
        this.ᐝᐝ = (ImageView) findViewById(o.bzd.b.ʾॱ);
    }

    private void ˊᐝ() {
        fhq ˏ = fho.ˏ();
        this.ˋॱ = (bwx) ˏ.ˋ("Operation").ॱ(bwx.class);
        this.ॱˎ = (bya) ˏ.ˋ("Option").ॱ(bya.class);
        this.ͺ = (bxz) ˏ.ˋ("Option").ॱ(bxz.class);
        this.ᐝॱ = ˏ.ˋ("Option").ˎ("option.publish");
    }

    private boolean ˋˊ() {
        return azb.ˎ((Context) this) && !epr.ˎ().ॱॱ();
    }

    private void ॱ(CharSequence charSequence) {
        if ((TextUtils.isEmpty(charSequence) || TextUtils.isEmpty(charSequence.toString().trim())) && this.ʽˋ == null) {
            this.ॱʼ.setImageResource(bzd.e.ॱˎ);
            this.ॱʻ.setClickable(false);
            return;
        }
        this.ॱʼ.setImageResource(bzd.e.ʻॱ);
        this.ॱʻ.setClickable(true);
    }

    public void onLayoutChange(View view, int i, int i2, int i3, int i4, int i5, int i6, int i7, int i8) {
        if (i8 != 0 && i4 != 0 && i8 - i4 > this.ꜟ) {
            bqx.ˏ("PostDetailActivity", "onLayoutChange onInputShow");
            ˎˎ();
        } else if (i8 != 0 && i4 != 0 && i4 - i8 > this.ꜟ) {
            bqx.ˏ("PostDetailActivity", "onLayoutChange onInputHide");
            ˋᐝ();
        }
    }

    protected void ᐝ() {
        if (this.ᶥ != null && this.ᶥ.ʻॱ()) {
            evr.ˊ().ˎ(ˍ());
        }
    }

    protected void ॱˊ() {
        if (this.ᶥ != null && this.ᶥ.ʻॱ()) {
            evr.ˊ().ˋ(ˍ());
        }
    }

    private ViewGroup ˍ() {
        if (getResources().getConfiguration().orientation == 2) {
            return (ViewGroup) findViewById(o.bzd.b.ˊʻ);
        }
        return (ViewGroup) findViewById(o.bzd.b.ॱꞌ);
    }

    private void ˋˋ() {
        if (ˊ(false)) {
            ॱ(new c(this) {
                final /* synthetic */ PostDetailActivity ॱ;

                {
                    this.ॱ = r1;
                }

                public void ˎ(boolean z) {
                    bqx.ˏ("PostDetailActivity", "doEditJump checkUser:" + z);
                    if (z) {
                        this.ॱ.ʽᐝ.sendEmptyMessageDelayed(1004, 50);
                    }
                }
            });
        }
    }

    private void ˋᐝ() {
        this.ˋˋ.setVisibility(8);
        this.ˏˎ.setVisibility(0);
        this.ॱͺ.setVisibility(0);
        if (this.ᶥ != null) {
            ॱ(this.ᶥ.ʻ());
        }
        this.ॱʻ.setVisibility(8);
        this.ͺॱ.clearFocus();
        this.ͺॱ.setMaxLines(1);
        this.ᐝˊ.setVisibility(8);
        LayoutParams layoutParams = this.ˎˏ.getLayoutParams();
        layoutParams.width = (int) getResources().getDimension(o.bzd.d.ॱॱ);
        this.ˎˏ.setLayoutParams(layoutParams);
        if (ˋˊ() && this.ʻᐝ && this.ʽˋ != null) {
            ˏ(false);
        }
        this.ʻᐝ = false;
        if (this.ॱˋ != null) {
            this.ॱˋ.ॱʾ();
        }
    }

    private void ˎˎ() {
        this.ˋˋ.setVisibility(0);
        this.ˏˎ.setVisibility(8);
        this.ॱʽ.setVisibility(8);
        this.ॱͺ.setVisibility(8);
        this.ॱʻ.setVisibility(0);
        LayoutParams layoutParams = this.ˎˏ.getLayoutParams();
        layoutParams.width = (int) getResources().getDimension(o.bzd.d.ʻ);
        this.ˎˏ.setLayoutParams(layoutParams);
        if (this.ʹ < 0 || this.ﾟ < 0) {
            int[] iArr = new int[2];
            this.ͺॱ.getLocationInWindow(iArr);
            ˋ(iArr, ˋ((Context) this), findViewById(o.bzd.b.ॱᐧ).getHeight());
        }
        if (this.ʽˋ != null) {
            this.ᐝˊ.setVisibility(0);
        }
        if (!TextUtils.isEmpty(this.ͺॱ.getText().toString())) {
            this.ͺॱ.setSelection(this.ͺॱ.getText().toString().length());
        }
        if (ˋˊ()) {
            if (this.ʽˋ != null) {
                ˏ(true);
            }
        } else if (this.ʽˋ != null) {
            this.ͺॱ.setMaxHeight(this.ʼˋ);
        } else {
            this.ͺॱ.setMaxHeight(this.ﾟ);
        }
        if (this.ʻˊ) {
            this.ʻᐝ = true;
        }
    }

    private void ˋ(int[] iArr, int i, int i2) {
        if (ˋˊ()) {
            if (this.ʹ < 0) {
                this.ʹ = (((iArr[1] - i) - i2) + this.ͺॱ.getHeight()) - ((int) getResources().getDimension(o.bzd.d.ʻ));
                bqx.ˏ("PostDetailActivity", "editMaxHeightLand:" + this.ʹ);
            }
        } else if (this.ﾟ < 0) {
            this.ﾟ = ((((iArr[1] - i) - i2) + this.ͺॱ.getHeight()) - 0) - (((int) getResources().getDimension(o.bzd.d.ʻ)) * 2);
            this.ʼˋ = this.ﾟ - this.ʻˋ;
            bqx.ˏ("PostDetailActivity", "editMaxHeight:" + this.ﾟ);
        }
    }

    private void ˏ(boolean z) {
        int height = this.ʹ - this.ͺॱ.getHeight();
        if (this.ʻˋ > 0 && this.ʻˋ > height) {
            if (z) {
                this.ˋᐝ.setTranslationY(((float) (this.ʻˋ - height)) + this.ˋᐝ.getTranslationY());
                return;
            }
            this.ˋᐝ.setTranslationY(this.ˋᐝ.getTranslationY() - ((float) (this.ʻˋ - height)));
        }
    }

    private void ॱ(c cVar) {
        if (doo.ˊ((Context) this)) {
            ((cbh) fho.ˏ().ˋ("User").ॱ(cbh.class)).ˎ(this, 15).ˏ(new b(cVar));
        } else {
            evk.ˏ(getString(bse.ˏ.ˏ()));
        }
    }

    public int ˋ(Context context) {
        int identifier = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
        if (identifier > 0) {
            return context.getResources().getDimensionPixelSize(identifier);
        }
        return 0;
    }

    public void onResume() {
        super.onResume();
        this.ˌ.addOnLayoutChangeListener(this);
        this.ˈॱ = dgh.ॱ();
        ᐝ();
    }

    public void onPause() {
        super.onPause();
        this.ˌ.removeOnLayoutChangeListener(this);
        IPostDetailProtocol iPostDetailProtocol = (IPostDetailProtocol) this.ˏॱ.ॱ();
        if (iPostDetailProtocol != null) {
            ean.ˏ(iPostDetailProtocol.getStayTimeKey(), System.currentTimeMillis() - this.ˈॱ, iPostDetailProtocol.getUri());
        }
    }

    public void finish() {
        super.finish();
        ˌ();
    }

    public void onSaveInstanceState(Bundle bundle) {
        bundle.putSerializable("param_post", this.ᶥ);
        bundle.putSerializable("param_section", this.ꓸ);
        bundle.putSerializable("param_user", this.ﹳ);
        bundle.putInt("param_favorite", this.ꜞ);
        bundle.putInt("param_like", this.ㆍ);
        bundle.putInt("param_input_maxheight", this.ﾟ);
        bundle.putInt("param_input_maxheight_image", this.ʼˋ);
        bundle.putInt("param_input_maxheight_land", this.ʹ);
        bundle.putSerializable("param_select_image", this.ʽˋ);
        bundle.putInt("param_select_image_height", this.ʻˋ);
        bundle.putInt("param_ismyselfmoderator", this.ʾॱ);
        bundle.putInt("param_ismyselfhost", this.ʽˊ);
        bundle.putString("video_content_description", this.ꞌ);
        super.onSaveInstanceState(bundle);
    }

    public boolean dispatchTouchEvent(MotionEvent motionEvent) {
        if (motionEvent.getAction() == 0 && ˏ(getCurrentFocus(), motionEvent) && ˏˎ()) {
            return true;
        }
        return super.dispatchTouchEvent(motionEvent);
    }

    public boolean ˏ(View view, MotionEvent motionEvent) {
        boolean z = true;
        if (this.ˋˋ == null || this.ˋˋ.getVisibility() != 0 || !(view instanceof EditText)) {
            return false;
        }
        int[] iArr = new int[]{0, 0};
        view.getLocationInWindow(iArr);
        if (motionEvent.getY() > ((float) iArr[1])) {
            z = false;
        }
        return z;
    }

    private void ˌ() {
        if (this.ͺ != null && this.ᶥ != null) {
            Object obj = this.ͺॱ.getText().toString();
            if (!TextUtils.isEmpty(obj) || this.ʽˋ != null) {
                this.ͺ.ˏ(new byg(this.ᶥ.ˏ(), obj, this.ʽˋ, this.ꓸ.ˊ()));
                bqx.ˏ("PostDetailActivity", "save draft");
            }
        }
    }

    public boolean ˋ(TaskFragment taskFragment, com.huawei.appgallery.foundation.ui.framework.cardframe.fragment.TaskFragment.b bVar) {
        if (!ActivityUtil.isAcitivtyNotValid(this)) {
            if (bVar.ˋ.getResponseCode() == 0 && bVar.ˋ.getRtnCode_() == 0 && (bVar.ˋ instanceof JGWTabDetailResponse)) {
                if (this.ˊʻ != 0) {
                    this.ˈ.setAlpha(0.0f);
                }
                JGWTabDetailResponse jGWTabDetailResponse = (JGWTabDetailResponse) bVar.ˋ;
                ˊ(jGWTabDetailResponse);
                this.ʻॱ = jGWTabDetailResponse.ʻ();
                this.ˊʻ = 0;
            } else {
                this.ˈ.setAlpha(1.0f);
                this.ˊʻ = -1;
                this.ˊˋ.setVisibility(8);
            }
        }
        return false;
    }

    public int ˎ() {
        return this.ﾞ;
    }

    public void ˏ(int i) {
        this.ﾞ = i;
    }

    private void ˊ(JGWTabDetailResponse jGWTabDetailResponse) {
        List<LayoutData> ᐝॱ = jGWTabDetailResponse.ᐝॱ();
        if (ᐝॱ != null && ᐝॱ.size() > 0) {
            for (LayoutData layoutData : ᐝॱ) {
                if (ForumPostDetailHeadCardBean.NAME.equals(layoutData.ˏ())) {
                    ForumPostDetailHeadCardBean forumPostDetailHeadCardBean = (ForumPostDetailHeadCardBean) layoutData.ˋ().get(0);
                    this.ʾॱ = forumPostDetailHeadCardBean.ॱˊ();
                    this.ʽˊ = forumPostDetailHeadCardBean.ˊॱ();
                    this.ꞌ = forumPostDetailHeadCardBean.v_();
                    ˏ(forumPostDetailHeadCardBean.ᐝ(), forumPostDetailHeadCardBean.ʽ(), forumPostDetailHeadCardBean.ʼ(), forumPostDetailHeadCardBean.ˏॱ(), forumPostDetailHeadCardBean.ͺ());
                    brd.ॱ.ॱ(bqy.ˋ().ˎ(this), this.ˊॱ, forumPostDetailHeadCardBean.ʽ() != null ? String.valueOf(forumPostDetailHeadCardBean.ʽ().ˊ()) : "", forumPostDetailHeadCardBean.ᐝ() != null ? String.valueOf(forumPostDetailHeadCardBean.ᐝ().ˏ()) : "", forumPostDetailHeadCardBean.ᐝ() != null ? String.valueOf(forumPostDetailHeadCardBean.ᐝ().ᐝ()) : "", this.ʿ != null ? this.ʿ : "");
                    return;
                }
            }
        }
    }

    private void ˏ(Post post, Section section, User user, int i, int i2) {
        this.ꓸ = section;
        this.ᶥ = post;
        this.ﹳ = user;
        this.ꜞ = i;
        this.ㆍ = i2;
        if (post != null && section != null && user != null) {
            ॱ(section);
            ˊ(user, post);
            ˎˏ();
            ˎ(post, i, i2);
            ͺॱ();
            if (this.ʽॱ) {
                ˋˋ();
                this.ʽॱ = false;
            }
            ˎ(true, false);
        }
    }

    private void ॱ(Section section) {
        if (ᐝॱ() && this.ˊʻ != 0) {
            this.ˊˊ.setVisibility(0);
            this.ˊˊ.setOnClickListener(this);
            eqx.ˏ(this.ˎˎ, section.ॱ(), "app_default_icon");
            this.ˍ.setText(section.ˏ());
        }
    }

    private void ˊ(final User user, final Post post) {
        boolean z = true;
        this.ˊˋ.setVisibility(0);
        this.ᐧ = new PopupMenu(this, this.ˊˋ);
        getMenuInflater().inflate(f.ˏ, this.ᐧ.getMenu());
        if (user.ʼ()) {
            this.ᐧ.getMenu().findItem(o.bzd.b.ॱـ).setVisible(false);
            this.ᐧ.getMenu().findItem(o.bzd.b.ˍ).setVisible(true);
            MenuItem findItem = this.ᐧ.getMenu().findItem(o.bzd.b.ꜞ);
            if (post.ᐝॱ()) {
                z = false;
            }
            findItem.setVisible(z);
        } else {
            this.ᐧ.getMenu().findItem(o.bzd.b.ॱـ).setVisible(true);
            this.ᐧ.getMenu().findItem(o.bzd.b.ˍ).setVisible(false);
            this.ᐧ.getMenu().findItem(o.bzd.b.ꜞ).setVisible(false);
        }
        this.ᐧ.setOnMenuItemClickListener(new OnMenuItemClickListener(this) {
            final /* synthetic */ PostDetailActivity ˋ;

            public boolean onMenuItemClick(MenuItem menuItem) {
                this.ˋ.ˊ(menuItem, user, post);
                return false;
            }
        });
    }

    private void ˎˏ() {
        if (this.ᶥ == null) {
            return;
        }
        if (this.ᶥ.ᐝॱ() && this.ᶥ.ʻॱ() && 1 == getResources().getConfiguration().orientation) {
            this.ˈ.setVisibility(8);
            ˏ(this.ᶥ, this.ꞌ);
            ॱˊ();
            return;
        }
        cgv.ˋ(this, a.ʽ, a.ˎ);
    }

    private void ˎ(Post post, int i, int i2) {
        this.ˋᐝ.setVisibility(0);
        this.ͺॱ.setHint(getResources().getQuantityString(g.ॱ, bsv.ॱ(String.valueOf(this.ᶥ.ʼ()), 0), new Object[]{Long.valueOf(this.ᶥ.ʼ())}));
        ॱ(post.ʻ());
        if (i == 1) {
            this.ـ.setImageResource(bzd.e.ʿ);
            this.ʼᐝ = 1;
        } else {
            this.ـ.setImageResource(bzd.e.ॱᐝ);
            this.ʼᐝ = 0;
        }
        if (i2 == 1) {
            this.ˑ.setImageResource(bzd.e.ʽ);
        } else {
            this.ˑ.setImageResource(bzd.e.ʻ);
        }
        this.ˏˎ.setOnClickListener(this);
        this.ॱͺ.setOnClickListener(this);
    }

    private void ˊ(MenuItem menuItem, User user, Post post) {
        boolean z = false;
        int itemId = menuItem.getItemId();
        if (itemId == o.bzd.b.ꜞ) {
            if (bsd.ˊ(this.ʻॱ)) {
                evk.ˏ(this, j.ˎ, 0).ˋ();
                z = true;
            } else {
                if (ˊ(true)) {
                    ˏˏ();
                    z = true;
                }
                z = true;
            }
        } else if (itemId == o.bzd.b.ˍ) {
            this.ˋॱ.ॱ(this, this.ᶥ.ˏ(), this.ˊॱ).ˏ(new fjq<Boolean>(this) {
                final /* synthetic */ PostDetailActivity ॱ;

                {
                    this.ॱ = r1;
                }

                public void onComplete(fjo<Boolean> o_fjo_java_lang_Boolean) {
                    if (o_fjo_java_lang_Boolean.ˊ() && ((Boolean) o_fjo_java_lang_Boolean.ॱ()).booleanValue()) {
                        this.ॱ.ˎ(true, true);
                        Intent intent = new Intent(bsn.ˊ);
                        intent.putExtra("cardId", String.valueOf(this.ॱ.ᶥ.ˋॱ()));
                        ll.ˏ(this.ॱ).ˋ(intent);
                        this.ॱ.finish();
                    }
                }
            });
            z = true;
        } else if (itemId == o.bzd.b.ॱـ) {
            if (ˊ(false)) {
                this.ˋॱ.ˎ(this, new o.bxv.d(user.ˎ(), user.ˋ(), 0, post.ˏ()).ˊ(post.ˊ()).ˎ(post.ॱ()).ॱ(post.ॱॱ()).ˏ(this.ˊॱ).ˎ());
                z = true;
            }
            z = true;
        }
        if (z) {
            this.ᐧ.dismiss();
        }
    }

    private void ॱ(long j) {
        if (j > 0) {
            this.ॱʽ.setVisibility(0);
            this.ॱʽ.setText(j > 999 ? "999+" : String.valueOf(j));
            return;
        }
        this.ॱʽ.setVisibility(8);
    }

    private void ͺॱ() {
        byg ˏ = this.ͺ.ˏ(this.ᶥ.ˏ());
        if (ˏ != null) {
            this.ͺॱ.setText(ˏ.ˊ());
            byl ॱ = ˏ.ॱ();
            if (ॱ != null) {
                this.ʽˋ = ॱ;
                ˎ(false, true, false);
                ˋ(ॱ);
                ॱ(ˏ.ˊ());
            }
        } else if (this.ʽˋ != null) {
            ˎ(false, true, false);
            ˋ(this.ʽˋ);
            ॱ(this.ͺॱ.getText().toString());
        }
        this.ͺॱ.setMaxLines(1);
        this.ᐝˊ.setVisibility(8);
        if (this.ʻˋ < 0) {
            this.ᐝˊ.measure(MeasureSpec.makeMeasureSpec(0, 0), MeasureSpec.makeMeasureSpec(0, 0));
            this.ʻˋ = this.ᐝˊ.getMeasuredHeight();
        }
    }

    private void ˑ() {
        bqx.ˏ("PostDetailActivity", "showInput");
        this.ͺॱ.setFocusable(true);
        this.ͺॱ.setFocusableInTouchMode(true);
        this.ͺॱ.requestFocus();
        ((InputMethodManager) getSystemService("input_method")).showSoftInput(this.ͺॱ, 0);
    }

    private boolean ˏˎ() {
        this.ͺॱ.clearFocus();
        ˋᐝ();
        return ((InputMethodManager) this.ͺॱ.getContext().getSystemService("input_method")).hideSoftInputFromWindow(this.ͺॱ.getWindowToken(), 0);
    }

    private boolean ˊ(boolean z) {
        if (!btb.ˊ(this, this.ᶥ.ॱˊ(), z)) {
            return false;
        }
        if (!z) {
            return true;
        }
        ॱ(new c(this) {
            final /* synthetic */ PostDetailActivity ˊ;

            {
                this.ˊ = r1;
            }

            public void ˎ(boolean z) {
                if (z) {
                    this.ˊ.ˏˏ();
                }
            }
        });
        return false;
    }

    private void ˎ(boolean z, boolean z2) {
        int i;
        int i2 = 0;
        fjf ˊ = fjf.ˊ(this);
        IPostDetailResult iPostDetailResult = (IPostDetailResult) ˊ.ॱ();
        iPostDetailResult.setLike(this.ㆍ);
        iPostDetailResult.setLikeCount(this.ᶥ == null ? 0 : this.ᶥ.ʻ());
        if (z2) {
            i = 2;
        } else {
            i = 0;
        }
        iPostDetailResult.setRtnCode(i);
        if (z) {
            i2 = -1;
        }
        setResult(i2, ˊ.ˊ());
    }

    private void ˏˏ() {
        this.ॱˎ.ˏ(this.ˊॱ, this, true, new byd(this.ꓸ.ˊ(), this.ᶥ.ˏ(), this.ᶥ.ˊ(), bzr.ˊ(this.ᶥ))).ˏ(new fjq<byj>(this) {
            final /* synthetic */ PostDetailActivity ॱ;

            {
                this.ॱ = r1;
            }

            public void onComplete(fjo<byj> o_fjo_o_byj) {
                if (o_fjo_o_byj.ˊ()) {
                    byd ˋ = ((byj) o_fjo_o_byj.ॱ()).ˋ();
                    if (ˋ == null) {
                        bqx.ˊ("PostDetailActivity", "iPublishPostActivityResult == null");
                        return;
                    }
                    bqx.ˏ("PostDetailActivity", "publish success，sectionid: " + ˋ.ˊ() + "  tid:" + ˋ.ˏ() + " title:" + ˋ.ॱ() + "  content:" + ˋ.ˎ());
                    bzr.ˏ(ˋ.ˋ(), this.ॱ.ᶥ, ˋ.ˎ(), ˋ.ॱ());
                    this.ॱ.ॱˋ.ॱـ();
                    evk.ˏ(this.ॱ.getString(j.ˏ));
                }
            }
        });
    }

    public void ˎ(TaskFragment taskFragment, List<cvt> list) {
    }

    public void ॱ(int i, int i2) {
        int i3 = this.ᐨ + i;
        if (this.ᐨ > 0) {
            if (i2 == -1) {
                this.ʽᐝ.sendEmptyMessageDelayed(1001, 300);
            } else {
                this.ʽᐝ.removeMessages(1001);
                if (i2 == 1 && i3 >= this.ᐨ) {
                    this.ʽᐝ.sendEmptyMessage(1002);
                }
            }
        }
        float ˎ = ˎ(i3, (int) getResources().getDimension(o.bzd.d.ˋॱ));
        Message message = new Message();
        message.what = 1003;
        message.obj = Float.valueOf(ˎ);
        this.ʽᐝ.sendMessage(message);
        if (getResources().getConfiguration().orientation == 2) {
            evr.ˊ().ॱ(this.ˊʼ);
        }
    }

    public void ˋ(AbsListView absListView, int i) {
        if (i == 0) {
            this.ʽᐝ.removeMessages(1001);
        }
        if (absListView.getLastVisiblePosition() == absListView.getCount() - 1 && ((double) this.ˈ.getAlpha()) > 0.01d) {
            Message message = new Message();
            message.what = 1003;
            message.obj = Float.valueOf(1.0f);
            this.ʽᐝ.sendMessage(message);
        }
        if (absListView.getFirstVisiblePosition() == 0 && this.ᐨ > 0) {
            View childAt = absListView.getChildAt(0);
            if (childAt != null && childAt.getTop() >= this.ᐨ) {
                this.ʽᐝ.sendEmptyMessage(1001);
            }
        }
        if (i == 0 && getResources().getConfiguration().orientation == 2) {
            ᐝ();
        }
        this.ˊʼ = i;
    }

    private float ˎ(int i, int i2) {
        if (i2 <= 0) {
            return 1.0f;
        }
        float floatValue = new BigDecimal(1.0d).divide(new BigDecimal(i2), 3, 0).floatValue() * ((float) i);
        if (floatValue <= 1.0f) {
            return floatValue;
        }
        return 1.0f;
    }

    public void onClick(View view) {
        if (view.getId() == o.bzd.b.ʽ) {
            onBackPressed();
        } else if (view.getId() == o.bzd.b.ㆍ) {
            this.ᐧ.show();
        } else if (!ˊ(false)) {
        } else {
            if (view.getId() == o.bzd.b.ʼˋ) {
                ᐝˋ();
            } else if (view.getId() == o.bzd.b.ʻˋ) {
                ᐝˊ();
            } else if (view.getId() == o.bzd.b.ʽˋ) {
                if (!this.ʼˊ) {
                    if (doo.ˊ((Context) this)) {
                        ॱͺ();
                    } else {
                        Toast.makeText(this, getString(bse.ˏ.ˏ()), 0).show();
                    }
                }
            } else if (view.getId() == o.bzd.b.ꞌ) {
                if (!this.ʼˊ) {
                    ॱʻ();
                }
            } else if (view.getId() == o.bzd.b.ﾟ) {
                if (!this.ʼˊ) {
                    ـ();
                }
            } else if (view.getId() == o.bzd.b.ॱᶥ) {
                cil.ˋ(ContentManager.getInstant().getContext(), new cim.a().ˊ(this.ꓸ.ॱॱ()).ˋ());
                fjb ˎ = fho.ˏ().ˋ("Section").ˎ("section_detail_activity");
                ISectionDetailActivityProtocol iSectionDetailActivityProtocol = (ISectionDetailActivityProtocol) ˎ.ˊ();
                iSectionDetailActivityProtocol.setUri(this.ꓸ.ॱॱ());
                iSectionDetailActivityProtocol.setDomainId(this.ˊॱ);
                fiu.ˊ().ˏ(this, ˎ);
            }
        }
    }

    private void ـ() {
        this.ʽˋ = null;
        ˎ(true, false, true);
        ॱ(this.ͺॱ.getText().toString());
    }

    private void ॱʻ() {
        String[] strArr = new String[]{"image/jpeg", "image/jpg", "image/png", "image/webp", "image/gif", "image/bmp"};
        fjb ˎ = fho.ˏ().ˋ("Media").ˎ("MediaSelect");
        IMediaSelectProtocol iMediaSelectProtocol = (IMediaSelectProtocol) ˎ.ˊ();
        iMediaSelectProtocol.setMediaType("image");
        iMediaSelectProtocol.setMimeTyes(strArr);
        iMediaSelectProtocol.setMaxSelectSize(1);
        iMediaSelectProtocol.setMaxSelectFileSize(10485760);
        fiu.ˊ().ॱ((Context) this, ˎ, new fjc<IMediaSelectResult>(this) {
            final /* synthetic */ PostDetailActivity ˎ;

            {
                this.ˎ = r1;
            }

            public /* synthetic */ void ˎ(int i, Object obj) {
                ˋ(i, (IMediaSelectResult) obj);
            }

            public void ˋ(int i, IMediaSelectResult iMediaSelectResult) {
                if (i == -1 && iMediaSelectResult != null) {
                    try {
                        List<OriginalMediaBean> selectedMedias = iMediaSelectResult.getSelectedMedias();
                        if (!CollectCheck.isEmpty((List) selectedMedias)) {
                            for (OriginalMediaBean originalMediaBean : selectedMedias) {
                                byl o_byl = new byl(originalMediaBean);
                                this.ˎ.ʽˋ = o_byl;
                                this.ˎ.ॱ(o_byl);
                                this.ˎ.ˎ(false, false, false);
                                this.ˎ.ˋ(o_byl);
                                this.ˎ.ʽᐝ.sendEmptyMessageDelayed(1004, 50);
                                this.ˎ.ॱ(null);
                                bqx.ˏ("PostDetailActivity", "URL IS :" + originalMediaBean.ʽ());
                            }
                        }
                    } catch (Exception e) {
                        bqx.ॱ("PostDetailActivity", "cast error");
                    }
                }
            }
        });
    }

    private void ॱ(byl o_byl) {
        ((bya) fho.ˏ().ˋ("Option").ॱ(bya.class)).ˎ(this.ˊॱ, o_byl, this.ᶥ.ˏ()).ˏ(new fjq<byl>(this) {
            final /* synthetic */ PostDetailActivity ॱ;

            {
                this.ॱ = r1;
            }

            public void onComplete(fjo<byl> o_fjo_o_byl) {
                if (o_fjo_o_byl.ˊ()) {
                    byl o_byl = (byl) o_fjo_o_byl.ॱ();
                    if (this.ॱ.ʽˋ != null && this.ॱ.ʽˋ.ॱॱ() == 2 && o_byl.ˋ().equals(this.ॱ.ʽˋ.ˋ())) {
                        bqx.ˏ("PostDetailActivity", "upload image success");
                        if (this.ॱ.ʼˊ) {
                            this.ॱ.ॱͺ();
                            return;
                        }
                        return;
                    }
                    bqx.ˏ("PostDetailActivity", "upload image failed");
                    if (this.ॱ.ʼˊ) {
                        this.ॱ.runOnUiThread(new Runnable(this) {
                            final /* synthetic */ AnonymousClass2 ˏ;

                            {
                                this.ˏ = r1;
                            }

                            public void run() {
                                evk.ˏ(this.ˏ.ॱ.getString(j.ˋ));
                                this.ˏ.ॱ.ॱʽ();
                            }
                        });
                    }
                }
            }
        });
    }

    private void ˎ(boolean z, boolean z2, boolean z3) {
        int i;
        this.ˋˋ.setClickable(z);
        this.ˏˏ.setImageResource(z ? bzd.e.ʾ : bzd.e.ˊˋ);
        View view = this.ᐝˊ;
        if (z) {
            i = 8;
        } else {
            i = 0;
        }
        view.setVisibility(i);
        if (ˋˊ() && z3) {
            if (z) {
                ˏ(false);
            } else {
                ˏ(true);
            }
        } else if (!z2 && this.ﾟ > 0) {
            if (z) {
                this.ͺॱ.setMaxHeight(this.ﾟ);
                return;
            }
            bqx.ˏ("PostDetailActivity", "new editMaxHeight:" + this.ʼˋ);
            this.ͺॱ.setMaxHeight(this.ʼˋ);
        }
    }

    private void ˋ(byl o_byl) {
        if (o_byl.ʼ()) {
            eqx.ˏ(this.ᐝᐝ, o_byl.ˏ(), "image_default_icon");
        } else {
            eqx.ˏ(this.ᐝᐝ, o_byl.ʽ(), "image_default_icon");
        }
    }

    private void ॱͺ() {
        if (this.ʽˋ == null || this.ʽˋ.ॱॱ() == 2) {
            ॱʼ();
            this.ॱˎ.ॱ(this.ˊॱ, new byg(this.ᶥ.ˏ(), this.ͺॱ.getText().toString(), this.ʽˋ, this.ꓸ.ˊ()), (Context) this).ˏ(new fjq<bye>(this) {
                final /* synthetic */ PostDetailActivity ॱ;

                {
                    this.ॱ = r1;
                }

                public void onComplete(fjo<bye> o_fjo_o_bye) {
                    this.ॱ.ॱʽ();
                    if (!o_fjo_o_bye.ˊ() || o_fjo_o_bye.ॱ() == null) {
                        bqx.ॱ("PostDetailActivity", "comment result fail.");
                        return;
                    }
                    bye o_bye = (bye) o_fjo_o_bye.ॱ();
                    bqx.ˊ("PostDetailActivity", "comment result :" + o_bye.ˎ());
                    if (o_bye.ˎ() == 0) {
                        this.ॱ.ॱˋ.ˎ(o_bye.ˏ(), this.ॱ.ꓸ.ˊ(), this.ॱ.ʾॱ, this.ॱ.ʽˊ);
                        if (this.ॱ.getCurrentFocus() != null) {
                            ((InputMethodManager) this.ॱ.getSystemService("input_method")).hideSoftInputFromWindow(this.ॱ.getCurrentFocus().getWindowToken(), 2);
                        }
                        this.ॱ.ͺॱ.setText("");
                        if (this.ॱ.ʽˋ != null) {
                            this.ॱ.ˎ(true, false, true);
                            this.ॱ.ʽˋ = null;
                        }
                        if (this.ॱ.ͺ.ˏ(this.ॱ.ᶥ.ˏ()) != null) {
                            this.ॱ.ͺ.ˊ();
                        }
                        this.ॱ.ॱ(null);
                        this.ॱ.ᶥ.ˎ(this.ॱ.ᶥ.ʼ() + 1);
                        this.ॱ.ͺॱ.setHint(this.ॱ.getResources().getQuantityString(g.ॱ, bsv.ॱ(String.valueOf(this.ॱ.ᶥ.ʼ()), 0), new Object[]{Long.valueOf(this.ॱ.ᶥ.ʼ())}));
                        evk.ˏ(this.ॱ.getString(j.ˊ));
                    }
                }
            });
            return;
        }
        ॱʼ();
        if (this.ʽˋ.ॱॱ() == 3) {
            ॱ(this.ʽˋ);
        }
    }

    private void ॱʼ() {
        this.ʼˊ = true;
        this.ᐝˋ.setVisibility(0);
        this.ॱʼ.setVisibility(8);
    }

    private void ॱʽ() {
        this.ʼˊ = false;
        this.ᐝˋ.setVisibility(8);
        this.ॱʼ.setVisibility(0);
    }

    private void ᐝˋ() {
        int i = 1;
        if (this.ˋॱ != null) {
            if (this.ㆍ != 1) {
                i = 0;
            }
            this.ˋॱ.ˊ(this, this.ᶥ.ॱˊ(), 0, this.ᶥ.ˏ(), i, this.ˊॱ, this.ꓸ.ˊ()).ˏ(new fke<bxc>(this) {
                final /* synthetic */ PostDetailActivity ˏ;

                {
                    this.ˏ = r1;
                }

                public /* synthetic */ void ॱ(Object obj) {
                    ˏ((bxc) obj);
                }

                public void ˎ(fkg o_fkg) {
                }

                public void ˏ(bxc o_bxc) {
                    if (o_bxc.ˏ() == 9 && o_bxc.ˎ()) {
                        bqx.ˏ("PostDetailActivity", "AUTHENTION_ACCESS is ok");
                        this.ˏ.ᐨ();
                    } else if (o_bxc.ˏ() == 0 && o_bxc.ˎ()) {
                        bqx.ˏ("PostDetailActivity", "response is ok");
                    } else if (o_bxc.ˏ() == -1 && !o_bxc.ˎ()) {
                        bqx.ˏ("PostDetailActivity", "response is fail");
                        this.ˏ.ᐨ();
                    }
                }

                public void ˊ(Exception exception) {
                }

                public void ॱ() {
                }
            });
        }
    }

    private void ᐨ() {
        if (this.ㆍ == 1) {
            this.ㆍ = 0;
            this.ᶥ.ˋ(this.ᶥ.ʻ() - 1);
            this.ˑ.setImageResource(bzd.e.ʻ);
        } else {
            this.ㆍ = 1;
            this.ᶥ.ˋ(this.ᶥ.ʻ() + 1);
            this.ˑ.setImageResource(bzd.e.ʽ);
        }
        ॱ(this.ᶥ.ʻ());
        ˎ(true, false);
    }

    private void ᐝˊ() {
        int i = 1;
        if (this.ˋॱ != null) {
            if (this.ꜞ == 1) {
                i = 0;
            }
            this.ˋॱ.ˏ((Context) this, this.ᶥ.ˏ(), i, this.ˊॱ).ˏ(new fke<bxc>(this) {
                final /* synthetic */ PostDetailActivity ˊ;

                {
                    this.ˊ = r1;
                }

                public /* synthetic */ void ॱ(Object obj) {
                    ˊ((bxc) obj);
                }

                public void ˎ(fkg o_fkg) {
                }

                public void ˊ(bxc o_bxc) {
                    if (o_bxc.ˏ() == 9 && o_bxc.ˎ()) {
                        bqx.ˏ("PostDetailActivity", "AUTHENTION_ACCESS is ok");
                        this.ˊ.ㆍ();
                    } else if (o_bxc.ˏ() == 0 && o_bxc.ˎ()) {
                        bqx.ˏ("PostDetailActivity", "response is ok");
                    } else if (o_bxc.ˏ() == -1 && !o_bxc.ˎ()) {
                        bqx.ˏ("PostDetailActivity", "response is fail");
                        this.ˊ.ㆍ();
                    }
                }

                public void ˊ(Exception exception) {
                }

                public void ॱ() {
                }
            });
        }
    }

    private void ㆍ() {
        if (this.ꜞ == 1) {
            this.ꜞ = 0;
            this.ـ.setImageResource(bzd.e.ॱᐝ);
            return;
        }
        this.ꜞ = 1;
        this.ـ.setImageResource(bzd.e.ʿ);
    }

    public void onDestroy() {
        super.onDestroy();
        if (this.ʼᐝ != this.ꜞ && this.ꜞ == 0) {
            Intent intent = new Intent(bsn.ˋ);
            intent.putExtra("cardId", String.valueOf(this.ᶥ.ˋॱ()));
            ll.ˏ(this).ˋ(intent);
        }
    }

    private void ꓸ() {
        if (this.ˊˊ.getVisibility() == 0) {
            Animation translateAnimation = new TranslateAnimation(0.0f, 0.0f, 0.0f, (float) (0 - this.ᐨ));
            translateAnimation.setDuration(500);
            translateAnimation.setFillEnabled(true);
            translateAnimation.setFillAfter(true);
            translateAnimation.setAnimationListener(new AnimationListener(this) {
                final /* synthetic */ PostDetailActivity ˏ;

                {
                    this.ˏ = r1;
                }

                public void onAnimationStart(Animation animation) {
                }

                public void onAnimationEnd(Animation animation) {
                    this.ˏ.ˊˊ.clearAnimation();
                }

                public void onAnimationRepeat(Animation animation) {
                }
            });
            this.ˊˊ.setAnimation(translateAnimation);
            this.ˊˊ.setVisibility(8);
        }
    }

    private void ᶥ() {
        if (this.ˊˊ.getVisibility() == 8) {
            this.ˊˊ.setVisibility(0);
            Animation translateAnimation = new TranslateAnimation(0.0f, 0.0f, (float) (0 - this.ᐨ), 0.0f);
            translateAnimation.setDuration(500);
            translateAnimation.setFillEnabled(true);
            translateAnimation.setFillAfter(true);
            translateAnimation.setAnimationListener(new AnimationListener(this) {
                final /* synthetic */ PostDetailActivity ˏ;

                {
                    this.ˏ = r1;
                }

                public void onAnimationStart(Animation animation) {
                }

                public void onAnimationEnd(Animation animation) {
                    this.ˏ.ˊˊ.clearAnimation();
                }

                public void onAnimationRepeat(Animation animation) {
                }
            });
            this.ˊˊ.setAnimation(translateAnimation);
        }
    }

    public void ˏ(String str) {
        this.ˊॱ = str;
    }

    private void ˏ(Post post, String str) {
        VideoInfo ʽ = post.ʽ();
        if (this.ˋˊ == null) {
            View inflate = this.ˊᐝ.inflate();
            this.ˋˊ = (VideoPlayer) inflate.findViewById(o.bzd.b.ॱﾞ);
            this.ˉ = inflate.findViewById(o.bzd.b.ॱꜟ);
        }
        if (this.ˋˊ == null) {
            ˎ(-16777216, 1.0f);
            return;
        }
        ˎ(-1, 1.0f);
        RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) this.ˋˊ.getLayoutParams();
        layoutParams.height = (azb.ॱ((Context) this) * 9) / 16;
        this.ˋˊ.setLayoutParams(layoutParams);
        int i = o.bsy.c.ʻ;
        int i2 = o.bsy.c.ˊॱ;
        String str2 = (String) this.ˉ.getTag(i);
        String str3 = (String) this.ˉ.getTag(i2);
        String ˎ = ʽ.ˎ();
        String ˊ = ʽ.ˊ();
        if (!TextUtils.isEmpty(str2) && str2.equals(ˎ)) {
            return;
        }
        if (TextUtils.isEmpty(str3) || !str3.equals(ˊ)) {
            this.ˉ.setTag(i, ˎ);
            this.ˉ.setTag(i2, ˊ);
            this.ˋˊ.setVideoBaseInfo(new o.evp.b().ˎ(ʽ.ॱ()).ˊ(ˊ).ˋ(ˎ).ʼ(ʽ.ˋ()).ᐝ(ʽ.ˋ()).ʻ(ʽ.ˏ()).ॱॱ(ʽ.ʻ()).ॱ());
            Context ˋ = ContentManager.getInstant().getContext();
            eqx.ˋ(ˋ.getResources().getDimensionPixelSize(o.bzd.d.ᐝ), ˋ.getResources().getDimensionPixelSize(o.bzd.d.ˋ), this.ˋˊ.ॱॱ(), ˊ);
            this.ˋˊ.ॱॱ().setContentDescription(str);
        }
    }
}
